package String;

public class IndexOfDemo {
    public static void main(String[] args) {
        String dell="thinking in china java";
        int index=dell.indexOf("in");
        System.out.println(index);
        index=dell.indexOf("in",3);
        System.out.println(index);
        index=dell.indexOf("ab");
        System.out.println(index);
        index=dell.lastIndexOf("in");
        System.out.println(index);

        String str="thinking in bb in china java";
        int pig=str.indexOf("b");
        System.out.println(pig);
        pig=str.indexOf("de",3);
        System.out.println(pig);
        pig=str.lastIndexOf("d");
        System.out.println(pig);
        String S="a";
        StringBuilder b=new StringBuilder("a");
        for(int i=0;i<100000000;i++){
            b.append(i);
        }
        System.out.println("执行完毕");
    }
}
